;;; personal-gui.el -- preferences/setup for Emacs running in a GUI window

;;;============================================================================
;;; MINOR MODE PREFERENCES

(scroll-bar-mode -1)
(tool-bar-mode -1)
(tooltip-mode -1)

;;;============================================================================
;;; VISUAL BELL

(defvar bell-flash-color "gold"
  "Use this color when flashing the mode line as a visual bell.")

(defun bell-flash-mode-line ()
  "Alert user by flashing mode line momentarily."
  (let ((frame (selected-frame))
        (original-bg (face-background 'mode-line nil 'default)))
    (set-face-attribute 'mode-line frame :background bell-flash-color)
    (sit-for 0.1)
    (set-face-attribute 'mode-line frame :background original-bg)))

(setq ring-bell-function 'bell-flash-mode-line)

;;;============================================================================
;;; BUILT-IN FACES

(set-face-foreground 'font-lock-builtin-face       "SteelBlue4")
(set-face-foreground 'font-lock-comment-face       "gray50")
(set-face-foreground 'font-lock-constant-face      "magenta3")
(set-face-foreground 'font-lock-doc-face           "orange2")
(set-face-foreground 'font-lock-function-name-face "OrangeRed2")
(set-face-foreground 'font-lock-keyword-face       "navy")
(set-face-foreground 'font-lock-string-face        "sienna3")
(set-face-foreground 'font-lock-type-face          "PaleGreen4")
(set-face-foreground 'font-lock-variable-name-face "green4")
(set-face-foreground 'font-lock-warning-face       "red3")
(set-face-background 'trailing-whitespace          "gold")
(set-face-background 'isearch                      "purple")
(set-face-background 'lazy-highlight               "violet")

;;;============================================================================
;;; YASNIPPET FACES

(when (featurep 'yasnippet)
  (set-face-background 'yas/field-highlight-face  "springgreen")
  (set-face-background 'yas/mirror-highlight-face "khaki2"))

(when (featurep 'dropdown-list)
  (set-face-attribute 'dropdown-list-face nil
                      :foreground "gray20" :background "gray80")
  (set-face-attribute 'dropdown-list-selection-face nil
                      :foreground "white" :background "navy"))

;;;============================================================================
;;; SHOW-PAREN-MODE FACES

(eval-after-load
 "paren"
 '(progn
    (set-face-background 'show-paren-match-face "SkyBlue3")
    (set-face-background 'show-paren-mismatch-face "red1")))

;;;============================================================================
;;; MMM-MODE FACES

(eval-after-load
    "mmm-mode"
  '(progn
     (set-face-background 'mmm-default-submode-face "gray96")))

;;;============================================================================
;;; CSS-COLOR-MODE (Bling!!!)

(autoload 'css-color-mode "mon-css-color" "Highlight and edit CSS colors." t)

(eval-after-load
    "css-mode"
  '(define-key css-mode-map (kbd "C-c c") 'css-color-mode))
